Remove icon extents API
authorTimm Bäder <mail@baedert.org>
Sun, 15 Jul 2018 16:52:48 +0000 (18:52 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 17 Jul 2018 15:33:47 +0000 (17:33 +0200)
gtk/gtkrendericon.c
gtk/gtkstylecontext.c

index 3ebb941008c12d4f5248be71b7c5dbab977ecb18..afed8b613dbb9c441dc3b74a5d25a414be9e374e 100644 (file)
@@ -229,45 +229,6 @@ gtk_css_style_render_icon_surface (GtkCssStyle            *style,
   cairo_set_matrix (cr, &saved_matrix);
 }
 
-void
-gtk_css_style_render_icon_get_extents (GtkCssStyle  *style,
-                                       GdkRectangle *extents,
-                                       gint          x,
-                                       gint          y,
-                                       gint          width,
-                                       gint          height)
-{
-  graphene_matrix_t transform_matrix, translate_matrix, matrix;
-  graphene_rect_t bounds;
-  GtkBorder border;
-
-  g_return_if_fail (GTK_IS_CSS_STYLE (style));
-  g_return_if_fail (extents != NULL);
-
-  extents->x = x;
-  extents->y = y;
-  extents->width = width;
-  extents->height = height;
-
-  if (!gtk_css_transform_value_get_matrix (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_TRANSFORM), &transform_matrix))
-    return;
-
-  graphene_matrix_init_translate (&translate_matrix, &GRAPHENE_POINT3D_INIT(x + width / 2.0, y + height / 2.0, 0));
-  graphene_matrix_multiply (&transform_matrix, &translate_matrix, &matrix);
-  graphene_rect_init (&bounds,
-                      - width / 2.0, - height / 2.0,
-                      width, height);
-  /* need to round to full pixels */
-  graphene_matrix_transform_bounds (&matrix, &bounds, &bounds);
-
-  _gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW), &border);
-
-  extents->x = floorf (bounds.origin.x) - border.left;
-  extents->y = floorf (bounds.origin.y) - border.top;
-  extents->width = ceilf (bounds.origin.x + bounds.size.width) - extents->x + border.right;
-  extents->height = ceilf (bounds.origin.y + bounds.size.height) - extents->y + border.bottom;
-}
-
 void
 gtk_css_style_snapshot_icon_paintable (GtkCssStyle  *style,
                                        GtkSnapshot  *snapshot,
index e9df80529cc179b64090ce392a787b1eef6b90df..d5d738aa475540b3fb7be3eac7bcf137d3554715 100644 (file)
@@ -1950,28 +1950,6 @@ gtk_style_context_get_change (GtkStyleContext *context)
   return priv->invalidating_context;
 }
 
-void
-_gtk_style_context_get_icon_extents (GtkStyleContext *context,
-                                     GdkRectangle    *extents,
-                                     gint             x,
-                                     gint             y,
-                                     gint             width,
-                                     gint             height)
-{
-  g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-  g_return_if_fail (extents != NULL);
-
-  if (_gtk_css_image_value_get_image (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_SOURCE)) == NULL)
-    {
-      extents->x = extents->y = extents->width = extents->height = 0;
-      return;
-    }
-
-  gtk_css_style_render_icon_get_extents (gtk_style_context_lookup_style (context),
-                                         extents,
-                                         x, y, width, height);
-}
-
 PangoAttrList *
 _gtk_style_context_get_pango_attributes (GtkStyleContext *context)
 {